﻿using Domain.Entities;
using Domain.Entities.ToDo;
using FrameworkCore.Attributes;
using System.Text.Json.Serialization;

namespace AiBLSmartEdu.Module.ToDo.API.DTOs;

/// <summary>
/// 待办事项
/// </summary>
[Map(typeof(ToDoItem))]
public class ToDoItemOutputModel
{
    public long Id { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string? Title { get; set; }

    /// <summary>
    /// 描述
    /// </summary>
    public string? Description { get; set; }

    [JsonIgnore]
    public List<ToDoItemCategory>? ToDoItemCategories { get; set; }

    /// <summary>
    /// 分类
    /// </summary>
    public List<long?> Categories => ToDoItemCategories?.Select(x => x.ToDoCategoryId).ToList();

    /// <summary>
    /// 任务截止日期
    /// </summary>
    public DateTime? DueDate { get; set; }

    /// <summary>
    /// 是否完成
    /// </summary>
    public bool? IsCompleted { get; set; } = false;

    /// <summary>
    /// 时间完成
    /// </summary>
    public DateTime? CompletedTime { get; set; }

    /// <summary>
    /// 任务等级
    /// </summary>
    public ToDoPriorityType? Priority { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime? Created { get; set; }

}
